﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

public static class PageExtensionMethods
{
    public static string ResolveUrlAbsolute(this Page p, string relativeUrl)
    {
        if (p.Request.IsSecureConnection)
            return string.Format("https://{0}{1}", p.Request.Url.Host, p.ResolveUrl(relativeUrl));
        else
            return string.Format("http://{0}{1}", p.Request.Url.Host, p.ResolveUrl(relativeUrl));
    }    
}
